package com.mygdx.game.desktop.demo.coldDown;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.mygdx.game.desktop.demo.coldDown.CHCircleProgressBar.PType;

public class ColdDownTest2Game extends Game {

	private Stage stage;
	private CHCircleProgressBar chCircleProgressBar;
	@Override
	public void create() {
		stage = new Stage();
		
		// 传入图片路径，冷却时长（单位：秒）,类型：圆形或矩形
		chCircleProgressBar = new CHCircleProgressBar("images/skill/frostbolt.jpg", 2, PType.RECANGLE);
		//System.out.println(chCircleProgressBar.getColor().a+","+chCircleProgressBar.getColor().r+","+chCircleProgressBar.getColor().g+","+chCircleProgressBar.getColor().b);
		 
		// 加入舞台
		stage.addActor(chCircleProgressBar);
		
		// 调用开始方法
		chCircleProgressBar.startProgress();
	}

	public void render() {
		Gdx.gl.glClearColor(1, 1, 1, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		stage.act();
		stage.draw();
		/*if(chCircleProgressBar.isStoped()) {
			chCircleProgressBar.setBgTexture(new Texture(Gdx.files.internal("images/skill/frostbolt.jpg")));
		}*/
	}

	public void dispose() {

	}

	// 当前切割位置的枚举
	public enum IntersectAt {
		NONE, TOP, BOTTOM, LEFT, RIGHT;
	}

	public static void main(String[] args) {
		new LwjglApplication(new ColdDownTest2Game());
	}
}
